package com.xiweicheng.test.jpa.entity;
// Generated 2018-7-13 22:08:49 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * ChatLabel generated by hbm2java
 */
@Entity
@Table(name = "chat_label", catalog = "tms")
public class ChatLabel implements java.io.Serializable {

	private Long id;
	private long version;
	private ChatChannel chatChannel;
	private ChatDirect chatDirect;
	private Users users;
	private Date createDate;
	private String description;
	private String name;
	private String status;
	private String type;
	private Set<Users> userses = new HashSet<Users>(0);

	public ChatLabel() {
	}

	public ChatLabel(String status, String type) {
		this.status = status;
		this.type = type;
	}

	public ChatLabel(ChatChannel chatChannel, ChatDirect chatDirect, Users users, Date createDate, String description,
			String name, String status, String type, Set<Users> userses) {
		this.chatChannel = chatChannel;
		this.chatDirect = chatDirect;
		this.users = users;
		this.createDate = createDate;
		this.description = description;
		this.name = name;
		this.status = status;
		this.type = type;
		this.userses = userses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "chat_channel")
	public ChatChannel getChatChannel() {
		return this.chatChannel;
	}

	public void setChatChannel(ChatChannel chatChannel) {
		this.chatChannel = chatChannel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "chat_direct")
	public ChatDirect getChatDirect() {
		return this.chatDirect;
	}

	public void setChatDirect(ChatDirect chatDirect) {
		this.chatDirect = chatDirect;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creator")
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "type", nullable = false)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "voter_chat_label", catalog = "tms", joinColumns = {
			@JoinColumn(name = "chat_label_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<Users> getUserses() {
		return this.userses;
	}

	public void setUserses(Set<Users> userses) {
		this.userses = userses;
	}

}
